package com.itfreer.gis.server.vector.mapbox;

import java.io.IOException;
import java.util.Map;
import no.ecc.vectortile.VectorTileEncoder;
import org.locationtech.jts.geom.Geometry;

import com.itfreer.gis.server.vector.generate.VectorTileBuilder;

/**
 * mapbox构建器
 */
public class MapBoxTileBuilder implements VectorTileBuilder {

	private VectorTileEncoder encoder;

	public MapBoxTileBuilder() {
		this.encoder = new VectorTileEncoderNoClip();
	}

	@Override
	public void addFeature(String layerName, long featureId, Geometry geometry,
			Map<String, Object> properties) {
		encoder.addFeature(layerName, properties, geometry, featureId);
	}

	@Override
	public byte[] build() throws IOException {
		return encoder.encode();
	}
}
